import $http from '../request';

const URL_PREFIX = '/datasource/database';

export const $DatabaseApi = {

	/**
	 * 获取数据库树数据
	 * @returns {*}
	 */
	getDatabaseTreeData: () => {
		return $http.$get(URL_PREFIX + "/getDatabaseTreeData", null, {});
	},

	createDatabase: (data) => {
		return $http.$post(URL_PREFIX + "/create", data);
	},

	/**
	 * 获取数据库类型 common system owned
	 * @returns 
	 */
	getDbTypeList: () => {
		return $http.$get(URL_PREFIX + "/getDatabaseTypes", null, {});
	},

	getDbList: (params) => {
		return $http.$post(URL_PREFIX + "/list", params);
	},

	/**
	 * 删除数据库, 可批量
	 */
	remove: (params) => {
		return $http.$post(URL_PREFIX + "/remove", params);
	},



}